Journals
  Publication Years
  Keywords
Search within results Open Search
Please wait a minute...
For Selected: Toggle Thumbnails
Coupling related code smell detection method based on deep learning
Shan SU, Yang ZHANG, Dongwen ZHANG
Journal of Computer Applications    2022, 42 (6): 1702-1707.   DOI: 10.11772/j.issn.1001-9081.2021061403
Abstract329)   HTML14)    PDF (1071KB)(108)       Save

Heuristic and machine learning based code smell detection methods have been proved to have limitations, and most of these methods focus on the common code smells. In order to solve these problems, a deep learning based method was proposed to detect three relatively rare code smells which are related to coupling, those are Intensive Coupling, Dispersed Coupling and Shotgun Surgery. First, the metrics of three code smells were extracted, and the obtained data were processed. Second, a deep learning model combining Convolutional Neural Network (CNN) and attention mechanism was constructed, and the introduced attention mechanism was able to assign weights to the metric features. The datasets were extracted from 21 open source projects, and the detection methods were validated in 10 open source projects and compared with CNN model. Experimental results show that the proposed model achieves the better performance with the code smell precisions of 93.61% and 99.76% for Intensive Coupling and Dispersed Coupling respectively, and the CNN model achieves the better results with the code smell precision of 98.59% for Shotgun Surgery.

Table and Figures | Reference | Related Articles | Metrics